<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="viewport" content="width=device-width,initial-scale=1.3, minimum-scale=1.3, maximum-scale=1.3, user-scalable=no"/>
	<link rel="icon" href="./logo.ico" type="image/x-ico"/>
	<title>Huiva</title>
</head>
<body background="back.gif">
	<form action="zx.php" method="post">
		<table>
			<tr>
				<td>本次扩容前账号数单价：<input type="number" name="yzhs" min="60" step="5" value="120"></tr>
			</tr>
			<tr>
				<td>本次扩容账号数：<input type="number" name="krs" min="1"></td>
			</tr>
			<!-- <tr>
				<td>剩余使用月数:<input type="number" name="syts" min="1"></td>
			</tr> -->
<!--			<tr>
				<td>开始日期：<input type="date" name="day1" ></td>
			</tr>	
			<tr>
				<td>到期日期：<input type="date" name="day2" ></td>
			</tr> -->
            <tr>
                <td>剩余月数:<input type="number" name="syts" min="1"> </td>
            </tr>
			<tr>
				<td><button type="submit">提交</button></td>
			</tr>
		</table>
	</form>
	<?php
		function diffbetween2days ($day1,$day2) {
        	$sec1 = strtotime($day1);
        	$sec2 = strtotime($day2);
        
        	if ($sec1 < $sec2) {
        	    $tmp = $sec2;
        	    $sec2 = $sec1;
        	    $sec1 = $tmp;
        	}
        	return ($sec1 - $sec2)/86400;
    	}
    	$day1 = $_POST["day1"];
    	$day2 = $_POST["day2"];
    	#$syts = diffbetween2days($day1,$day2);
		$yzhs = $_POST["yzhs"];
		$krs = $_POST["krs"];
		$syts = $_POST["syts"];

		$shell = "python zx.py $yzhs $krs $syts";
		system($shell,$status);
	?>
</body>

